import { Controller } from 'egg';

export default class VersionIOController extends Controller {
  public async index() {
    console.log('VersionIOController index', this.ctx.path);
    const message = this.ctx.args[0];
    console.log('VersionIOController index message', message);
    await this.ctx.socket.emit('version_change', `Hi! I've got your message: ${message}`);
  }

  public async testSocket() {
    console.log('VersionIOController test');
    await this.ctx.socket.emit('test', 'hello test');
    this.ctx.body = 'success';
  }
}
